package com.ruoyi.jihuo.initializer;

import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.ruoyi.jihuo.domain.Categories;
import com.ruoyi.jihuo.service.CategoriesService;
import com.ruoyi.jihuo.service.DataInitializer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author：LXY
 * @DATE：2025-08-09 15:26
 * @Description：模版类目数据初始化
 */
@Component
public class templateCategoryInitializer implements DataInitializer {
    private static List<Categories> categoriesList = new ArrayList<>();
    @Autowired
    private CategoriesService categoriesService;

    private List<Categories> listInit() {
        categoriesList.add(new Categories("腾讯", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("QQ专区", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("网络游戏点卡", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("游戏服务", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("服饰配件/皮带/帽子/围巾", null, "TE_FI_CA","50010404"));
        categoriesList.add(new Categories("流行男鞋", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("男装", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("女士内衣/男士内衣/家居服", null, "TE_FI_CA","1625"));
        categoriesList.add(new Categories("女鞋", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("女装/女士精品", null, "TE_FI_CA","16"));
        categoriesList.add(new Categories("箱包皮具/热销女包/男包", null, "TE_FI_CA","50006842"));
        categoriesList.add(new Categories("3C数码配件", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("DIY电脑", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("MP3/MP4/iPod/录音笔", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("办公设备/耗材/相关服务", null, "TE_FI_CA","50007218"));
        categoriesList.add(new Categories("笔记本电脑", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("电脑硬件/显示器/电脑周边", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("电玩/配件/游戏/攻略", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("电子元器件市场", null, "TE_FI_CA","50024099"));
        categoriesList.add(new Categories("二手数码", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("品牌台机/品牌一体机/服务器", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("平板电脑/MID", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("闪存卡/盘/存储/移动硬盘", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("手机", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("数码相机/单反相机/摄像机", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("网络设备/网络相关", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("文具电教/文化用品/商务用品", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("厨房电器", null, "TE_FI_CA","50012082"));
        categoriesList.add(new Categories("大家电", null, "TE_FI_CA","50022703"));
        categoriesList.add(new Categories("个人护理/保健/按摩器材", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("家庭保健", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("生活电器", null, "TE_FI_CA","50012100"));
        categoriesList.add(new Categories("影音电器", null, "TE_FI_CA","50011972"));
        categoriesList.add(new Categories("ZIPPO/瑞士军刀/眼镜", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("彩妆/香水/美妆工具", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("美发护发/假发", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("美容护肤/美体/精油", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("美容美体仪器", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("饰品/流行首饰/时尚饰品", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("手表", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("珠宝/钻石/翡翠/黄金", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("奶粉/辅食/营养品/零食", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("童鞋/婴儿鞋/亲子鞋", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("童装/婴儿装/亲子装", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("玩具/童车/益智/积木/模型", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("婴童用品", null, "TE_FI_CA","50014812"));
        categoriesList.add(new Categories("孕妇装/孕产妇用品/营养", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("床上用品", null, "TE_FI_CA","50008163"));
        categoriesList.add(new Categories("电子/电工", null, "TE_FI_CA","50020579"));
        categoriesList.add(new Categories("基础建材", null, "TE_FI_CA","50020332"));
        categoriesList.add(new Categories("家居饰品", null, "TE_FI_CA","50020808"));
        categoriesList.add(new Categories("家装主材", null, "TE_FI_CA","27"));
        categoriesList.add(new Categories("居家布艺", null, "TE_FI_CA","122852001"));
        categoriesList.add(new Categories("全屋定制", null, "TE_FI_CA","124050001"));
        categoriesList.add(new Categories("商业/办公家具", null, "TE_FI_CA","50020611"));
        categoriesList.add(new Categories("特色手工艺", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("五金/工具", null, "TE_FI_CA","50020485"));
        categoriesList.add(new Categories("住宅家具", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("装修设计/施工/监理", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("保健食品/膳食营养补充食品", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("餐饮具", null, "TE_FI_CA","122952001"));
        categoriesList.add(new Categories("保健用品", null, "TE_FI_CA","50023717"));
        categoriesList.add(new Categories("茶", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("成人用品/情趣用品", null, "TE_FI_CA","2813"));
        categoriesList.add(new Categories("厨房/烹饪用具", null, "TE_FI_CA","50016349"));
        categoriesList.add(new Categories("传统滋补营养品", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("家庭/个人清洁工具", null, "TE_FI_CA","50016348"));
        categoriesList.add(new Categories("节庆用品/礼品", null, "TE_FI_CA","122950001"));
        categoriesList.add(new Categories("酒类", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("居家日用", null, "TE_FI_CA","21"));
        categoriesList.add(new Categories("咖啡/麦片/冲饮", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("粮油调味/速食/干货/烘焙", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("零食/坚果/特产", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("收纳整理", null, "TE_FI_CA","122928002"));
        categoriesList.add(new Categories("水产肉类/新鲜蔬果/熟食", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("洗护清洁剂/卫生巾/纸/香薰", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("电动车/配件/交通工具", null, "TE_FI_CA","124354002"));
        categoriesList.add(new Categories("户外/登山/野营/旅行用品", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("运动/瑜伽/健身/球迷用品", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("运动包/户外包/配件", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("运动服/休闲服装", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("运动鞋", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("自行车/骑行装备/零配件", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("度假线路/签证送关/旅游服务", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("景点门票/演艺演出/周边游", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("模玩/动漫/周边/娃圈三坑/桌游", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("书籍/杂志/报纸", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("数字阅读", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("特价酒店/特色客栈/公寓旅馆", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("音乐/影视/明星/音像", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("文玩/邮币/字画/收藏", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("本地化生活服务", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("餐饮美食卡券", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("宠物/宠物食品及用品", null, "TE_FI_CA","29"));
        categoriesList.add(new Categories("电影/演出/体育赛事", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("个性定制/设计服务/DIY", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("购物提货券", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("教育培训", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("网店/网络服务/软件", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("网络店铺代金/优惠券", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("鲜花速递/花卉仿真/绿植园艺", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("线下消费卡", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("阿里通信专展类目", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("搬运/仓储/物流设备", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("包装", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("标准件/零部件/工业耗材", null, "TE_FI_CA","127492006"));
        categoriesList.add(new Categories("到家业务", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("兑换卡", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("纺织面料/辅料/配套", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("工业油品/胶粘/化学/实验室用品", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("公益", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("购物金", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("机械设备", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("家装灯饰光源", null, "TE_FI_CA","126700003"));
        categoriesList.add(new Categories("金属材料及制品", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("能源出行", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("农机/农具/农膜", null, "TE_FI_CA","124468001"));
        categoriesList.add(new Categories("农用物资", null, "TE_FI_CA","124466001"));
        categoriesList.add(new Categories("拍卖会专用", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("其他", null, "TE_FI_CA","50023724"));
        categoriesList.add(new Categories("汽车零部件/养护/美容/维保", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("清洗/食品/商业设备", null, "TE_FI_CA","127876007"));
        categoriesList.add(new Categories("人工智能服务", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("商务/设计服务", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("商业加盟", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("室内设计师", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("数字生活", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("淘女郎", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("橡塑材料及制品", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("畜牧/养殖物资", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("医疗器械", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("婴童尿裤", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("智能设备", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("众筹", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("装修服务", null, "TE_FI_CA",null));
        categoriesList.add(new Categories("资产", null, "TE_FI_CA",null));
        return categoriesList;
    }

    @Override
    public Integer getIndex() {
        return 0;
    }

    @Override
    public void init() throws Exception {
        categoriesService.saveBatch(categoriesList);
    }

    @Override
    public boolean isNeedInit() {
        listInit();
        List<Categories> list = categoriesService.list();
        if (ObjectUtils.isEmpty(list)) {
            return true;
        }
        return list.size() < categoriesList.size();
    }
}
